package org.ssssssss.script.runtime;

public class MagicScriptClassLoader extends ClassLoader{

	public MagicScriptClassLoader(ClassLoader parent) {
		super(parent);
	}

	/**
	 *
	 * @author  zgn
	 * @date    2023/4/18 0018
	 * @param	className 类名
	 * @param	bytecode 字节码
	 * @return	java.lang.Class<org.ssssssss.script.runtime.MagicScriptRuntime>
	 */
	public synchronized Class<MagicScriptRuntime> load(String className, byte[] bytecode) throws ClassNotFoundException {
		//动态加载Java类
		defineClass(className, bytecode, 0 , bytecode.length);
		return (Class<MagicScriptRuntime>) loadClass(className);
	}
}
